using Machine.Specifications;
using Unbound.Tests.Unbinding.TestObjects;
using Unbound.ValueUnbinders;

namespace Unbound.Tests.Unbinding.Specifications.SpecificUnbinders
{
	[Subject("Custom unbinders")]
	public class specifying_a_special_unbinder : unbinding<ComplexType>
	{
		Establish context = () =>
		                    	{
		                    		ModelType = typeof (int);
		                    		Request = new ComplexType {Number = 3, Text = "foo"};
		                    		Prefix = string.Empty;

		                    		SpecificValueUnbinderFactory.CustomUnbinders
		                    			= () => new ISpecificValueUnbinder[]
		                    			        	{
		                    			        		new TestUnbinder(),
		                    			        	};
		                    	};

		It should_bind_value = () => Bound.ShouldEqual(3);
	}
}